<!-- Data Tables -->
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>{:lang('Confirm the purchase')}</h5>
                </div>
                <div class="ibox-content">
                    <form class="form-horizontal m-t" enctype="multipart/form-data" action="{:url('mall/pay')}" method="post">
                        <div class="form-group" style="text-align: center;">
                            
                                
                                    <img class="image" height="300" width="280" alt="image" src="/{$img.path}">
                                
                                
                            
                        </div>
                        <div class="form-group" style="text-align: center;">
                           
                            
                                <h3>{$goods.name}</h3>
                        </div>

                        <div class="form-group" style="text-align: center;">
                           
                            
                                <h5>{:lang('price')} {$goods.price}</h5>
                                <input  type="hidden" id="price" name ="price" class="form-control" value="{$goods.price}" readonly="readonly">
                                <input  type="hidden" id="id" name ="id" class="form-control" value="{$goods.id}" readonly="readonly">
                        </div>
                        
                        

                        <div class="form-group">
                            <label class="col-sm-3 control-label">{:lang('Commodity Description')}：</label>
                            <div class="col-sm-8">
                                
                                {$goods.remark}
                            </div>
                        </div>


                        <div class="form-group">
                            <label class="col-sm-3 control-label">{:lang('Purchase quantity')}：</label>
                            <div class="col-sm-8">
                                <input  type="number" id="num" name="num" class="form-control" value="1" placeholder="{:lang('Purchase quantity')}">
                                
                            </div>
                        </div>
                        
                        

                        <div class="form-group">
                            <label class="col-sm-3 control-label">{:lang('Shipping address')}：</label>
                            <div class="col-sm-8">
                                <input  type="text" class="form-control" id="address" name="address" value="{$address.address}" placeholder="{:lang('Province, city, street, residence.')} ">
                                
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">{:lang('Consignee')}：</label>
                            <div class="col-sm-8">
                                <input  type="text" id="consignee" name ="consignee" class="form-control" value="{$address.consignee}" placeholder="{:lang('Consignee')}">
                                
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">{:lang('Phone')}：</label>
                            <div class="col-sm-8">
                                <input  type="text" id="phone" name ="phone"  class="form-control" value="{$address.phone}" placeholder="{:lang('Phone')}">
                                
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label"></label>
                            <div class="col-sm-8">
                                {:lang('Total price')} : <label id="label1">{$goods.price}</label>                             
                            </div>
                        </div>
                        
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-3">
                                
                                <button class="btn btn-primary" onclick="return confirmd()" type="submit">{:lang('Pay')}</button>
                                
                            </div>


                            
                        </div>
                    </form>
                        
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    


    function confirmd() 
    {  
        var msg = "{:lang('Do you confirm payment purchase?')}";  
        if (confirm(msg)==true){  
                return true;  
        }else{  
                return false;  
        }  
    }  


     $("#num").blur(function()
    {
       
       var price=$("#price").val();
       var num=$("#num").val();
       var total = num * price;

        $('#label1').text(total);



    });


</script>


<script type="text/javascript">

    function operateFormatter(value, row, index) {
        return [
            '<a class="btn btn-xs edit" href="javascript:void(0)" title="{$Think.lang.Edit}">',
            '<i class="fa fa-edit"></i>',
            '</a>  ',
            '<a class="btn btn-xs delete" href="javascript:void(0)" title="{$Think.lang.Delete}">',
            '<i class="fa fa-trash"></i>',
            '</a>'
        ].join('');
    }

    var operateEvents = {
        'click .edit': function (e, value, row, index) {
            var param = {
                url: "{:url('admin/user/edit');}",
                data: {id: row.id}
            }
            $("#table").gridView('loadModal', param.url,param.data)
        },
        'click .delete': function (e, value, row, index) {
            $("#table").gridView('deleteModal', 'delete', row)
            
        }
    };
</script>
<script type="text/javascript">
    function copyText() {
      var eth = document.getElementById("eth");
      eth.select(); 
      document.execCommand("Copy"); 
      alert("{:lang('Duplicate success')}");
    }
</script>  



<script type="text/javascript">
        var aaa = document.getElementById("rrr"); 
        var input = document.getElementById("file_input"); 
              
              
        if(typeof FileReader==='undefined'){ 
            aaa.innerHTML = "No FileReader"; 
            input.setAttribute('disabled','disabled'); 
        }else{ 
            input.addEventListener('change',readFile,false); 
        } 

              
        function readFile(){ 
            var file = this.files[0]; 
            
            if(!/image\/\w+/.test(file.type)){ 
               
                return false; 
            } 
            
            var reader = new FileReader(); 
            reader.readAsDataURL(file);
            reader.onload = function(e){ 
                aaa.innerHTML = '<img height="400" width="300" src="'+this.result+'" alt=""/>' 
            } 
        }
    </script>

